How do I get the character position of a string in Python